package com.zking.web.ly;

import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.zking.dao.domain.MyResume;
import com.zking.service.ly.PreviewService;

@Controller
public class PreviewController {
	@Autowired
	private PreviewService ps;
	
	@RequestMapping(value = "/selectsly")
	public ModelAndView selects(Integer id, HttpServletRequest request) {
		System.out.println("id:"+id);
		ModelAndView modelAndView = new ModelAndView();
		MyResume mr = ps.selec(id);
		if (mr != null) {
			modelAndView.addObject("mr", mr);
			modelAndView.setViewName("preview");
		}else {
			System.out.println("无数据");
			request.setAttribute("mgs", "您还没有简历！");
			modelAndView.setViewName("jianli");
		}
		return modelAndView;
	}
}
